#include "book.h"


book::book()
{
	author = "";
	pages = -1;
}

book::book(string name, string author, int year, int pages) : multimedia(name, year){
	this->author = author;
	this->pages = pages;
}

book::~book()
{
}

void book::print(){
	cout << "book;" << name << "; " << author << "; " << year << "; " << pages;
}
ostream & operator<< (ostream &o, book &b){
	o << "book;" << b.name << "; " << b.author << "; " << b.year << "; " << b.pages;
	return o;
}

istream & operator>> (istream &i, book &b){
	getline(i, b.name, ';');
	getline(i, b.author, ';');
	i >> b.year;
	i.get();
	i >> b.pages;
	i.get();
	return i;
}
